package com.zhu.ttwords.view.listener;

import android.support.v4.view.ViewPager;

import com.zhu.ttwords.presenter.StudyPresenter;

/**
 * Created by KnightYe on 2015/4/5.
 */
public class StudyListener implements ViewPager.OnPageChangeListener {
    StudyPresenter presenter;
    public StudyListener(StudyPresenter presenter) {
        this.presenter = presenter;
    }

    @Override
    public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
    }

    @Override
    public void onPageSelected(int position) {
        presenter.updatePageIndex(position + 1);
    }

    @Override
    public void onPageScrollStateChanged(int state) {
    }
}
